package com.maxmlr.concurrent.queue;

import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.TransferQueue;

/**
 * @ClassName LinkedTransferQueueTest
 * @Description 消息直接处理队列
 * @Author maxiao
 * @Date 2020/2/26 下午5:19
 * @Version V1.0
 */
public class LinkedTransferQueueTest {

    static TransferQueue<String> queue = new LinkedTransferQueue();

    public static void main(String[] args) {

        new Thread(()->{
            try {
                String take = queue.take();
                System.out.println(take);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        try {
            queue.transfer("eee");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
